package util;

import io.AsyncCall;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class DefaultThreadPool implements ThreadPool {

	protected ExecutorService executor;
	
	public DefaultThreadPool(int min,int max){
		executor = new ThreadPoolExecutor(min,max,60L,TimeUnit.SECONDS,new LinkedBlockingQueue<Runnable>());
	}
	
	@Override
	public void execute(AsyncCall call) {
		executor.execute(call);
	}

}
